/**
 * Copyright 2020 Inc.
 **/
package com.myz.cloud.rocketmq.consumer.mq;

import com.alibaba.fastjson.JSONObject;
import com.myz.cloud.rocketmq.config.Order;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.springframework.stereotype.Component;

/**
 * @author maoyz0621 on 2020/8/11
 * @version v1.0
 */
@RocketMQMessageListener(topic = "${rocketmq.topic.ext}",
        consumerGroup = "${rocketmq.topic.ext}",
        selectorExpression = "*")
@Component
@Slf4j
public class MqConsumerConvent extends BaseRocketMQListener<Order> {

    @Override
    protected void doConsumerMsg(String message) {

        Order msg = JSONObject.parseObject(message, Order.class);
        log.info(msg.toString());
    }
}